/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package api.supplier;

import Model.ProductUser.ProductUserView;
import Model.User.UserSupplierPurchase1View;
import RssEasy.Core.HttpRequestHelper;
import RssEasy.Core.ServletRequestHelper;
import RssEasy.Core.SignVerifyRequestHelper;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author admin
 */
@WebServlet(name = "api_supplier", urlPatterns = {"/api/supplier"})
public class supplier extends ServletRequestHelper {

    public HttpRequestHelper request(HttpServletRequest request, HttpServletResponse response) {
        super.request(request, response);
        try {
            UserSupplierPurchase1View puv = new UserSupplierPurchase1View(this.pageContext);
            puv.request();
            puv.select("corpname,linkname,telphone,fulladress,mainbusiness,logo").where("corpname like '%" +this.get("corpname") + "%' and mainbusiness like'%" + this.get("mainbusiness") + "%'").query();
            out.print(puv.toKeyValue());
        } catch (Exception e) {
        }
        return this;
    }

}
